package com.sdx.console.answer.service;

import java.util.List;

import org.beetl.sql.core.engine.PageQuery;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.ibeetl.admin.core.util.PlatformException;

import com.sdx.console.answer.dao.QaAnswerInviteDao;
import com.sdx.console.answer.entity.QaAnswerInvite;
import com.ibeetl.admin.core.service.BaseService;

/**
 * 邀请回答 Service
 */

@Service
@Transactional
public class QaAnswerInviteService extends BaseService<QaAnswerInvite>{

    @Resource
	private QaAnswerInviteDao qaAnswerInviteDao;

    public PageQuery<QaAnswerInvite>queryByCondition(PageQuery query){
        PageQuery ret =  qaAnswerInviteDao.queryByCondition(query);
        queryListAfter(ret.getList());
        return ret;
    }

    public void batchDelQaAnswerInvite(List<String> ids){
        try {
            qaAnswerInviteDao.batchDelQaAnswerInviteByIds(ids);
        } catch (Exception e) {
            throw new PlatformException("批量删除邀请回答失败", e);
        }
    }

	public List<QaAnswerInvite> all() {
		return qaAnswerInviteDao.all();
		}
}